home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / Dreamweaver 3 / Configuration / Behaviors / Actions / Set Text / Set Text of Status Bar.js < prev    next >
Encoding:
Text File  |  1999-12-01  |  2.1 KB  |  83 lines

  1. // Copyright 1999 Macromedia, Inc. All rights reserved.
  2.  
  3. //*************** GLOBALS VARS *****************
  4.  
  5. var helpDoc = MM.HELP_behSetTextOfStatusBar;
  6.  
  7. //******************* BEHAVIOR FUNCTION **********************
  8.  
  9. //Displays a message in the status bar at the bottom of the
  10. //browser window. Passed the following arg:
  11. //  msgStr - a string
  12. //
  13. //This simple function, passed a string, sets the status property.
  14. //This is especially useful for having links display a help message when
  15. //the mouse is over them. Normally, links display the HREF value, unless
  16. //we return "true". Because we could have many actions to a single event,
  17. //here we set a global return value, which gets returned after all
  18. //Action function calls, with an inserted "return(document.MM_returnValue)".
  19.  
  20. function MM_displayStatusMsg(msgStr) { //v1.0
  21.   status=msgStr;
  22.   document.MM_returnValue = true;
  23. }
  24.  
  25.  
  26. //******************* API **********************
  27.  
  28.  
  29. //Can be used with any tag and any event
  30.  
  31. function canAcceptBehavior(){
  32.   var retVal = "onMouseOver,(onMouseOver),onClick,(onClick)"; //default events
  33.   return retVal;
  34. }
  35.  
  36.  
  37.  
  38. //Returns a Javascript function to be inserted in HTML head with script tags.
  39.  
  40. function behaviorFunction(){
  41.   return "MM_displayStatusMsg";
  42. }
  43.  
  44.  
  45.  
  46. //Returns fn call to insert in HTML tag <TAG... onEvent='thisFn(arg)'>
  47.  
  48. function applyBehavior() {
  49.   var index,frameObj,presBg,msgStr="",retVal;
  50.   with (document.theForm) {
  51.     msgStr = escExprStr(message.value,false);
  52.   }
  53.   if (msgStr == null) retVal = MSG_BadBraces;
  54.   else retVal = "MM_displayStatusMsg('"+msgStr+"')";
  55.   return retVal
  56. }
  57.  
  58.  
  59.  
  60. //Passed the function call above, takes prior arguments and reloads the UI.
  61. //Removes any escape characters "\"
  62.  
  63. function inspectBehavior(fnStr){
  64.   var argArray, msgStr;
  65.  
  66.   argArray = extractExprStr(fnStr);
  67.   if (argArray.length == 1) { //expect 1 arg
  68.     document.theForm.message.value = unescExprStr(argArray[0],false);
  69.   }
  70. }
  71.  
  72.  
  73.  
  74. //***************** LOCAL FUNCTIONS  ******************
  75.  
  76.  
  77. //Load up the frames, set the insertion point
  78.  
  79. function initializeUI(){
  80.   document.theForm.message.focus(); //set focus on textbox
  81.   document.theForm.message.select(); //set insertion point into textbox
  82. }
  83.